package com.eastfair.venuebooking.vo;

import com.eastfair.annotation.annotation.dictionary.DictionaryField;
import com.eastfair.annotation.annotation.vo.VoInfo;
import com.eastfair.venuebooking.demand.SaleClueGroup;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;

/**
 * 销售线索 VO.
 *
 * @author dqq
 * @date 2022 /6/14
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString(callSuper = true)
@Accessors(chain = true)
public class SaleClueVO implements Serializable {

    private Map<String, Object> echoMap = new HashMap<>();

    @VoInfo(groups = {SaleClueGroup.QuerySaleClue.class})
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "主键")
    private Long id;

    /**
     * 是否启用：1是；0否
     */
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "是否启用：1是；0否")
    private Integer isEnabled;
    /**
     * 是否删除：1是；0否
     */
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "是否删除：1是；0否")
    private Integer isDeleted;
    /**
     * 项目id
     */
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "项目id")
    private Long projectId;
    /**
     * 子系统id
     */
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "子系统id")
    private Long subsystemId;
    /**
     * 租户id
     */
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "租户id")
    private Long tenantId;
    /**
     * 归属人员
     */
    @VoInfo(groups = {SaleClueGroup.QuerySaleClue.class})
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "归属人员")
    private Long belongTo;
    /**
     * 归属人姓名
     */
    @VoInfo(groups = {SaleClueGroup.QuerySaleClue.class})
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "归属人姓名")
    @Size(max = 255, message = "归属人姓名长度不能超过255")
    private String belongToName;
    /**
     * 归属人员部门id
     */
    @ApiModelProperty(value = "归属人员部门id")
    @VoInfo(groups = {SaleClueGroup.QuerySaleClue.class})
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Long orgCode;
    /**
     * 归属人员部门名称
     */
    @ApiModelProperty(value = "归属人员部门名称")
    @VoInfo(groups = {SaleClueGroup.QuerySaleClue.class})
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String orgName;
    /**
     * 前归属部门
     */
    @ApiModelProperty(value = "前归属部门")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Long lastOrgCode;

    /**
     * 前归属部门名称
     */
    @ApiModelProperty(value = "前归属部门名称")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String lastOrgName;

    /**
     * 线索标题
     */
    @VoInfo(groups = {SaleClueGroup.QuerySaleClue.class})
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "线索标题")
    @Size(max = 75, message = "线索标题长度不能超过75")
    private String clueTitle;
    /**
     * 线索来源，同名数据字典
     */
    @DictionaryField(type = "CLUE_SOURCE")
    @VoInfo(groups = {SaleClueGroup.QuerySaleClue.class})
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "线索来源，同名数据字典")
    @Size(max = 64, message = "线索来源，同名数据字典长度不能超过64")
    private String clueSource;
    /**
     * 线索状态(同名数据字典)
     */
    @DictionaryField(type = "CLUE_STATUS")
    @VoInfo(groups = {SaleClueGroup.QuerySaleClue.class})
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "线索状态(同名数据字典)")
    @Size(max = 64, message = "线索状态(同名数据字典)长度不能超过64")
    private String clueStatus;
    /**
     * 前归属人
     */
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "前归属人")
    private Long lastBelongTo;
    /**
     * 前归属人姓名
     */
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "前归属人姓名")
    @Size(max = 255, message = "前归属人姓名长度不能超过255")
    private String lastBelongToName;
    /**
     * 部门id
     */
    @VoInfo(groups = {SaleClueGroup.QuerySaleClue.class})
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "部门id")
    private Long deptId;
    /**
     * 客户id
     */
    @VoInfo(groups = {SaleClueGroup.QuerySaleClue.class})
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "客户id")
    private Long customerId;
    /**
     * 客户名称
     */
    @VoInfo(groups = {SaleClueGroup.QuerySaleClue.class})
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "客户名称")
    @Size(max = 64, message = "客户名称长度不能超过64")
    private String customerName;
    /**
     * 联系人id
     */
    @VoInfo(groups = {SaleClueGroup.QuerySaleClue.class})
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "联系人id")
    private Long contactId;
    /**
     * 联系人姓名
     */
    @VoInfo(groups = {SaleClueGroup.QuerySaleClue.class})
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "联系人姓名")
    @Size(max = 20, message = "联系人姓名长度不能超过20")
    private String contactName;
    /**
     * 备注
     */
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "备注")
    @Size(max = 1000, message = "备注长度不能超过1000")
    private String remark;
    /**
     * 最后跟进时间
     */
    @VoInfo(groups = {SaleClueGroup.QuerySaleClue.class})
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "最后跟进时间")
    private LocalDateTime lastFollowDate;
    /**
     * 下次跟进时间
     */
    @VoInfo(groups = {SaleClueGroup.QuerySaleClue.class})
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "下次跟进时间")
    private LocalDateTime nextFollowDate;
    /**
     * 数据状态(0正常 1公共)
     */
    @VoInfo(groups = {SaleClueGroup.QuerySaleClue.class})
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "数据状态(0正常 1公共)")
    private Integer state;
    /**
     * 展会id
     */
    @VoInfo(groups = {SaleClueGroup.QuerySaleClue.class})
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "展会id")
    private Long exhibition;

    /**
     * 展会名称
     */
    @VoInfo(groups = {SaleClueGroup.QuerySaleClue.class})
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "展会名称")
    private String exhibitionName;

    /**
     * 联系人手机号
     */
    @VoInfo(groups = {SaleClueGroup.QuerySaleClue.class})
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "联系人手机号")
    private String contactMobile;

    /**
     * 联系人尊称
     */
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "联系人尊称")
    private String contactGender;

    /**
     * 角色
     */
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "角色")
    private String role;

    /**
     * 岗位
     */
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "岗位")
    private String post;

    /**
     * 未跟进天数
     */
    @VoInfo(groups = {SaleClueGroup.QuerySaleClue.class})
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "未跟进天数")
    private Integer notFollowDays;

    /**
     * 客户星级，同名字典
     */
    @DictionaryField(type = "CUSTOMER_LEVEL")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "客户星级")
    private String customerLevel;

    /**
     * 客户类型，同名数据字典
     */
    @DictionaryField(type = "CUSTOMER_TYPE")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "客户类型")
    private String customerType;

    /**
     * 所属行业
     */
    @DictionaryField(type = "CUSTOMER_INDUSTRY")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "客户所属行业")
    private String customerIndustry;

    /**
     * 客户举办类型 (SPONSOR:主办;UNDERTAKE:承办)
     */
    @ApiModelProperty(value = "客户举办类型 (SPONSOR:主办;UNDERTAKE:承办)")
    @Size(max = 64, message = "客户举办类型 (SPONSOR:主办;UNDERTAKE:承办)长度不能超过64")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {SaleClueGroup.QuerySaleClue.class})
    private String customerIdentity;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "创建人")
    private Long createdBy;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "创建人姓名")
    private String createdByName;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "更新人")
    private Long updatedBy;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "更新人姓名")
    private String updatedByName;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "更新时间")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    protected LocalDateTime updateTime;
}
